export  default  {
  addCart(state, payload) {
    // let oldProduct=state.CartList.find(item=>{item.iid===payload.iid})
    let oldProduct =null;
    for(let item of state.CartList) {
      if (item.iid === payload.iid) {
        oldProduct = item;
      }
    }
    if(oldProduct){
      // context.commit("addCounter",oldProduct)
      oldProduct.count+=1;
    }else{
      payload.count=1;
      payload.checked=true;
      state.CartList.push(payload)
      // context.commit("addCart",payload)
    }
  }
}
